<template>
	<view>
			<view class="page-body">
				<view class="page-section page-section-gap">
					<map style="width: 100%; height: 100vh;" :latitude="latitude" :longitude="longitude" :markers="mapList" :scale='13' @callouttap="markertap">
					</map>
				</view>
			</view>
		</view>
</template>

<script>
	export default {
		props: ["mapList"],
		
		data() {
			
			return{
				  latitude:wx.getStorageSync('nowLat') , //纬度
				  longitude:wx.getStorageSync('nowLgt'),//经度
				  scale:13,//缩放级别
				  bottomData:false,
				  tapId:'',
				  mapList1:'',
				  // covers:[
						
						// {
						//    id:4,
						//    latitude: 26.58214,//纬度
						//    longitude: 104.86445,//经度
						//    iconPath:'https://recruit-oss.oss-cn-beijing.aliyuncs.com/recruit/img/lg/mapLogo.png',    //显示的图标
						//    rotate:0,   // 旋转度数
						//    width:20,   //宽
						//    height:20,   //高
						//    //   title:'我在这里',//标注点名
						//    // alpha:0.5,   //透明度
						// 	callout:{//自定义标记点上方的气泡窗口 点击有效
						// 	content:'六盘水凤凰山企业',//文本
						// 	color:'#ffffff',//文字颜色
						// 	fontSize:10,//文本大小
						// 	borderRadius:15,//边框圆角
						// 	borderWidth:'1',
						// 	bgColor:'#0099FF',//背景颜色
						// 	display:'ALWAYS',//常显
						// 	padding:12,
						// 	},
						// },
																  
																  
				  // ],
			}
			
		},
		mounted() {
			console.log(this.mapList,'--latitude');
			console.log(this.mapList.longitude,'longitude');
		},
		 watch: {
		      mapList: {
		        immediate: true,
		        handler(value) {
					if(value.length>0  && value[0].keyWord!='' ){
						this.latitude = value[0].latitude;
						this.longitude = value[0].longitude;
					}else{
						 this.latitude = wx.getStorageSync('nowLat');
						 this.longitude = wx.getStorageSync('nowLgt');
					}
					
		          console.log(value,"----监听0")
		        }
		      }
		    },
		
		
		methods: {
			markertap(e){
				console.log(e,'子组件');
				
				this.tapId=e
				if(this.tapId){
					this.$emit('son',this.tapId)
				}
				
			},
			
	
		},
		
		 
	}
</script>

<style>
</style>